

module components {
	export class proxyChoushui extends eui.Component {
		public constructor(obj: Object) {
			super();
			this.obj = obj;
			this.addEventListener(eui.UIEvent.COMPLETE, this.init, this);
			this.addEventListener(egret.Event.REMOVED, this.destroy, this)
			this.skinName = "resource/ui/components/Proxy_choushuiSkin.exml";
		}
		public obj;
		public shijian: eui.Label;
		public jiangli: eui.Label;
		public zhankai: eui.Image;
		public mingxi: eui.Group;
		public mingxi2: eui.Group;

		private init() {
			this.removeEventListener(eui.UIEvent.COMPLETE, this.init, this);
			this.shijian.text = this.obj["DateStr"]
			this.jiangli.text = this.obj["TotalReward"]
			this.addEventListener(egret.TouchEvent.TOUCH_TAP, this.zhankaiClick, this)
			this.mingxi.visible = false;
			this.height = 61;
			var y = 0;
			var SubDetailNode: Array<any> = this.obj["SubDetailNode"]
			for (var i = 0; i < SubDetailNode.length; i++) {
				var obj = SubDetailNode[i];
				var bg = new eui.Image("proxy_hd")
				bg.y = y;
				var name = new eui.Label(obj["NickName"])
				name.x = 10
				name.y = y + 10;
				name.size = 26;
				name.textColor = 0xe2d3ae
				name.width = 200
				name.textAlign = "center"

				var ChouShui = new eui.Label(obj["ChouShui"])
				ChouShui.x = 360
				ChouShui.y = y + 10
				ChouShui.size = 26
				ChouShui.textColor = 0x5eb3e0
				ChouShui.width = 150
				ChouShui.textAlign = "center"

				var avlChouShui = new eui.Label(obj["avlChouShui"])
				avlChouShui.x = 695
				avlChouShui.y = y + 10
				avlChouShui.size = 26
				avlChouShui.textColor = 0x5eb3e0
				avlChouShui.width = 150
				avlChouShui.textAlign = "center"

				this.mingxi2.addChild(bg)
				this.mingxi2.addChild(name)
				this.mingxi2.addChild(ChouShui)
				this.mingxi2.addChild(avlChouShui)
				y += 50;
			}

		}
		private destroy() {
			this.removeEventListener(egret.Event.REMOVED, this.destroy, this)
			this.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.zhankaiClick, this)
		}
		private zhankaiClick() {
			if (this.mingxi.visible == false) {
				this.zhankai.rotation = 0;
				this.mingxi.visible = true;
				this.height = undefined
			} else {
				this.zhankai.rotation = 180;
				this.height = 61;
				this.mingxi.visible = false;
			}
		}
	}
}